<?php
header("Content-type: application/x-msdownload; charset=utf-8");
header("Content-Disposition: attachment; filename=seguimiento.xls");
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
        <table>
            <thead>
            <th>MUNICIPIO</th>
            <th>VEREDA</th>
            <th>CODIGO DE AVALUO</th>
            <th>NO. CATASTRAL</th>
            <th>DIRECCIÓN</th>
            <th>PROPIETARIO</th>
            <th>ÁREA</th>
            <th>TOPOGRAFÍA</th>
            <th>VALORES TOPOGRAFÍA</th>
            <th>VALOR AVALUO</th>
            <th>VALOR CONSTRUCCIONES</th>
            <th>VALOR ANEXOS</th>
            <th>VALOR ELEMENTOS PERMANENTES</th>
            <th>TOTAL</th>
            <th>FECHA AVALUO</th>
        </thead>
        <tbody>
            <?php
            if ($datos->num_rows() > 0) {
                foreach ($datos->result() as $row) {
                    echo "<tr>";
                    echo "<td>{$row->ciudadNombre}</td>";
                    echo "<td>{$row->visitaVereda}</td>";
                    echo "<td>{$row->avaluoNumero}</td>";
                    echo "<td>{$row->visitaNumCatastral}</td>";
                    echo "<td>{$row->visitaVeredaNombre}</td>";
                    echo "<td>{$row->visitaPropietario}</td>";
                    echo "<td>{$row->visitaTerreno}</td>";
                    echo "<td>{$row->topografia}</td>";
                    echo "<td>{$row->valTopografia}</td>";
                    echo "<td>{$row->totalAvaluo}</td>";
                    echo "<td>{$row->totalConstrucciones}</td>";
                    echo "<td>{$row->totalAnexos}</td>";
                    echo "<td>{$row->totalElementos}</td>";
                    echo "<td>{$row->totalGEN}</td>";
                    echo "<td>{$row->visitaFechaAvaluo}</td>";
                    echo "</tr>";
                }
            } else {
                echo "<tr><td>No se registran visitas</td></tr>";
            }
            ?>
        </tbody>
    </table>

</body>
</html>
